package com.kmxd.ams.client.archive.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 整理规则-分类管理
 *
 * @author nickbi
 * @since 2022-07-19
 */
@Data
@ColumnWidth(15)
@HeadRowHeight(15)
@ContentRowHeight(15)
@HeadStyle
@HeadFontStyle(fontHeightInPoints = 12)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
@ContentFontStyle(fontHeightInPoints = 10)
@ExcelIgnoreUnannotated
@Schema(description = "整理规则-分类管理对象")
public class ArchiveClassifyListVO implements Serializable {

  private static final long serialVersionUID = 1L;

  @Schema(description = "主键ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "主键ID")
  private Long id;

  @Schema(description = "全宗ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "全宗ID")
  private Long fondsId;

  @Schema(description = "门类配置id 将s_archive_rule表中的arch_type_id冗余过来，便于查询")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "门类配置id 将s_archive_rule表中的arch_type_id冗余过来，便于查询")
  private Long archiveTypeId;

  @Schema(description = "父节点id 父节点id，自关联，顶层默认0")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "父节点id 父节点id，自关联，顶层默认0")
  private Long pid;

  @Schema(description = "分类号")
  @ExcelProperty(value = "分类号")
  private String code;

  @Schema(description = "名称")
  @ExcelProperty(value = "名称")
  private String name;

  @Schema(description = "路径 取父节点的path字段加上/自己id/作为参数值")
  @ExcelProperty(value = "路径 取父节点的path字段加上/自己id/作为参数值")
  private String path;

  @Schema(
      description = "code路径 取父节点的pathcode字段加上[s_archive_rule.separator]+[自己code]作为值。顶级节点是[自己code]")
  @ExcelProperty(
      value = "code路径 取父节点的pathcode字段加上[s_archive_rule.separator]+[自己code]作为值。顶级节点是[自己code]")
  private String pathCode;

  @Schema(description = "归档范围")
  @ExcelProperty(value = "归档范围")
  private String pigeonhole;

  @Schema(description = "保管期限")
  @ExcelProperty(value = "保管期限")
  private String deadline;

  @Schema(description = "密级")
  @ExcelProperty(value = "密级")
  private String secret;

  @Schema(description = "关联版本信息")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "关联版本信息")
  private Long versionId;

  @Schema(description = "从0开始")
  @ExcelProperty(value = "从0开始")
  private Integer level;

  @Schema(description = "备注")
  @ExcelProperty(value = "备注")
  private String remark;

  @Schema(description = "默认值")
  @ExcelProperty(value = "默认值")
  private String defaultValue;

  @Schema(description = "提示信息")
  @ExcelProperty(value = "提示信息")
  private String alertInfo;

  @Schema(description = "排序")
  @ExcelProperty(value = "排序")
  private Integer sort;

  @Schema(description = "创建人")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "创建人")
  private Long createBy;

  @Schema(description = "创建时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ColumnWidth(20)
  @ExcelProperty(value = "创建时间")
  private Date createTime;

  @Schema(description = "更新人")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "更新人")
  private Long updateBy;

  @Schema(description = "更新时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ColumnWidth(20)
  @ExcelProperty(value = "更新时间")
  private Date updateTime;

  @Schema(description = "删除状态(0-正常,1-已删除)")
  @ExcelProperty(value = "删除状态(0-正常,1-已删除)")
  private Long delFlag;
}
